<%@ page import="com.gdpa.entity.DistrArea" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/12/31 0031
  Time: 16:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>分销房源表信息管理</title>

    <style>
        th{text-align: center;}
    </style>
    <link rel="stylesheet" href="/static/commons/layui/css/layui.css">
</head>
<body>
<h2 align="center">分销房源表信息管理</h2><br>

<%
   DistrArea area = (DistrArea)request.getSession().getAttribute("area");
%>
<div style="text-align:left;width: 250px;float: right;">
    <a style="color: #00F7DE" href="/distr-building/toBuilding?data=<%=area.getDistrAreaId()%>">返回上级楼盘</a>
    <a style="color: #00F7DE" href="/distr-area/allArea"> | 返回上级区域</a>
</div>
<form class="layui-form layui-form-pane" action="" method="post" id="form">

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">楼层</label>
            <div class="layui-input-inline">
                <input type="text" name="floor" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">房间号</label>
            <div class="layui-input-inline">
                <input type="text" name="distrHouseNumber" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">面积</label>
            <div class="layui-input-inline">
                <input type="text" name="area" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">价格</label>
            <div class="layui-input-inline">
                <input type="text" name="price" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline">
            <select name="state" >
                <option value="1">可售</option>
                <option value="2">已定</option>
                <option value="3">已签</option>
            </select>
        </div>
    </div>
    <div style="width: 625px;text-align: center">
        <input type="hidden" name="distrBuildingId" value="${build.distrBuildingId}">
        <button class="layui-btn layui-btn-normal" id="findHouse">查询</button>
        <button class="layui-btn layui-btn-normal" id="addHouse">添加</button>
    </div>
</form>

<div style="text-align: center">
    <hr class="layui-bg-green">
    <table class="layui-table">
        <thead class="layui-table">
        <tr>
            <th>楼盘名称</th>
            <th>楼层</th>
            <th>房间号</th>
            <th>面积(平方米)</th>
            <th>价格(元/平方米)</th>
            <th>状态</th>
            <th colspan="3">操作</th>
        </tr>
        </thead>
        <tbody class="layui-table">
        <c:forEach items="${list}" var="list">
            <tr>
                <td>${build.distrBuildingName}</td>
                <td>${list.floor}</td>
                <td>${list.distrHouseNumber}</td>
                <td>${list.area}</td>
                <td>${list.price}</td>
                <td>
                    <c:if test="${list.state==1}" var="var">
                        可售
                    </c:if>
                    <c:if test="${list.state==2}" var="var">
                        已定
                    </c:if>
                    <c:if test="${list.state==3}" var="var">
                        已签
                    </c:if>
                </td>
                <td>修改</td>
                <td><a href="/distr-house/deleteHouse?data=${list.distrHouseId}">删除</a></td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<script src="/static/commons/layui/layui.js"></script>
<script src="/static/js/distr_house/house_manage.js"></script>
</body>
</html>
